package cn.com.dcsgo.api.client;

import cn.com.dcsgo.api.dto.NotificationDTO;
import cn.com.dcsgo.api.fallback.NotificationClientFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * NotificationClient
 *
 * @author Dcsgo
 * @since 2025/4/3 17:01
 */
@FeignClient(value = "notification-service", fallback = NotificationClientFallback.class)
public interface NotificationClient {

    /**
     * 添加通知
     *
     * @param notificationDTO notificationDTO
     * @return 添加成功返回true, 失败返回false
     */
    @PostMapping("api/notification")
    boolean add(@RequestBody NotificationDTO notificationDTO);

    /**
     * 通过id更新通知
     *
     * @param notificationDTO notificationDTO
     * @return 更新成功返回true, 失败返回false
     */
    @PutMapping("api/notification")
    boolean updateById(@RequestBody NotificationDTO notificationDTO);

    /**
     * 获取所有通知
     *
     * @return List<NotificationDTO>
     */
    @GetMapping("api/notification")
    List<NotificationDTO> getAll();

    /**
     * 根据用户ID获取通知
     *
     * @param userId userId
     * @return List<NotificationDTO>
     */
    @GetMapping("api/notification/userId")
    List<NotificationDTO> getByUserId(@RequestParam("userId") Long userId, @RequestParam("isRight") Boolean isRight);
}
